Eclipse Platform
Pre-release 3.0

org.eclipse.ui.commands
Interface IWorkbenchCommandSupport


public interface IWorkbenchCommandSupport

An instance of this interface provides support for managing commands at the IWorkbench level.

This interface is not intended to be extended or implemented by clients.

EXPERIMENTAL

Since:
3.0
See Also:
IWorkbench#getAdaptable

Method Summary
 void deregisterFromKeyBindings(Shell shell)
          Deregisters the given shell from the global key bindings.
 void disableKeyFilter()
          Disables the global key binding architecture.
 void enableKeyFilter()
          Enables the global key binding architecture.
 ICommandManager getCommandManager()
          Returns the command manager for the workbench.
 ICompoundCommandHandlerService getCompoundCommandHandlerService()
          Returns the compound command handler service for the workbench.
 org.eclipse.ui.internal.keys.WorkbenchKeyboard getKeyboard()
          An accessor for the keyboard interface this workbench is using.
 boolean isKeyFilterEnabled()
          Tests whether the global key binding architecture is currently active.
 void registerForKeyBindings(Shell shell, boolean dialogOnly)
          Indicates that the given shell wishes to participate in the global key binding architecture.
 

Method Detail

deregisterFromKeyBindings

public void deregisterFromKeyBindings(Shell shell)
Deregisters the given shell from the global key bindings. This is not strictly necessary (as the internal storage uses a weak hash map), but is good for cleanliness.

Parameters:
shell - The shell to deregister; may be null.

disableKeyFilter

public void disableKeyFilter()
Disables the global key binding architecture. This means that no key events will trapped as keyboard shortcuts, and that no commands can be triggered by keyboard events. (Exception: it is possible that someone listening for key events on a widget could trigger a command.)


enableKeyFilter

public void enableKeyFilter()
Enables the global key binding architecture. The architecture should be enabled by default. This means that keyboard shortcuts are active, and that key events can trigger commands. This also means that widgets may not see all key events (as they might be trapped as a keyboard shortcut).


getCommandManager

public ICommandManager getCommandManager()
Returns the command manager for the workbench.

Returns:
the command manager for the workbench. Guaranteed not to be null.

getCompoundCommandHandlerService

public ICompoundCommandHandlerService getCompoundCommandHandlerService()
Returns the compound command handler service for the workbench.

Returns:
the compound command handler service for the workbench. Guaranteed not to be null.

getKeyboard

public org.eclipse.ui.internal.keys.WorkbenchKeyboard getKeyboard()
An accessor for the keyboard interface this workbench is using. This can be used by external class to get a reference with which they can simulate key presses in the key binding architecture. This is used for testing purposes currently.

Returns:
A reference to the workbench keyboard interface; never null.

isKeyFilterEnabled

public boolean isKeyFilterEnabled()
Tests whether the global key binding architecture is currently active.

Returns:
true if the key bindings are active; false otherwise.

registerForKeyBindings

public void registerForKeyBindings(Shell shell,
                                   boolean dialogOnly)
Indicates that the given shell wishes to participate in the global key binding architecture. This means that key and traversal events might be intercepted before reaching any of the widgets on the shell.

Parameters:
shell - The shell to register for key bindings; may be null.
dialogOnly - Whether the shell only wants the restricted set of key bindings normally used in dialogs (e.g., text editing commands). All workbench windows say false here.

Eclipse Platform
Pre-release 3.0

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.